<template>
	<view>
		<view class="page">
			<comp-common v-bind="{data:data}" @getUserInfo="getUserInfo" @myLogin="myLogin" @getPhoneNumber="getPhoneNumber" @hideGetCoupon="hideGetCoupon" @closeCouponBox="closeCouponBox" @navigatorClick="navigatorClick"></comp-common>
			<comp-header v-bind="{data:data}" @relevanceError="relevanceError" @relevanceSuccess="relevanceSuccess"></comp-header>
			<view class="body after-navber">
				<view class="info">
            <view class="info-title flex-row">
                <navigator class="flex-x-center width" openType="redirect" url="/pages/cash-detail/cash-detail?status=-1">
                    <view :class="['info-text', data.status==-1?'active':'']">全部</view>
                </navigator>
                <navigator class="flex-x-center  width" openType="redirect" url="/pages/cash-detail/cash-detail?status=0">
                    <view :class="['info-text', data.status==0?'active':'']">待审核</view>
                </navigator>
                <navigator class="flex-x-center  width" openType="redirect" url="/pages/cash-detail/cash-detail?status=1">
                    <view :class="['info-text', data.status==1?'active':'']">待打款</view>
                </navigator>
                <navigator class="flex-x-center  width" openType="redirect" url="/pages/cash-detail/cash-detail?status=2">
                    <view :class="['info-text', data.status==2?'active':'']">已打款</view>
                </navigator>
                <navigator class="flex-x-center  width" openType="redirect" url="/pages/cash-detail/cash-detail?status=3">
                    <view :class="['info-text', data.status==3?'active':'']">无效</view>
                </navigator>
            </view>
            <view style="margin-top:100upx;">
                <view class="info-no" v-if="data.show_no_data_tip">暂无信息</view>
                <block v-else>
                    <view class="info-content" v-for="(item,index) in data.cash_list" :key="item.id">
                        <view class="info-label flex-row">
                            <view class="info-left">
                                <view class="info-up">提现 {{item.price}}</view>
                                <view class="info-down">{{item.addtime}}</view>
                            </view>
                            <view class="info-right">
                                <block v-if="item.status==null">
                                        已打款
                                    </block>
                                <block v-else>
                                        {{item.status}}
                                    </block>
                            </view>
                        </view>
                    </view>
                </block>
            </view>
        </view>
			</view>
			<comp-footer v-bind="{data:data}"></comp-footer>
		</view>
	</view>
</template>

<script>var myVue = {};
	import Vue from 'vue'
	var t = Vue.prototype.getApp, a = (Vue.prototype.getApp.api, !1), s = !1, e = 2;
	export default {
		data() {
			return {
				data: {
        status: -1,
        cash_list: [],
        show_no_data_tip: !1
    },
			};
		},
		onLoad: function(o) {myVue = this;
        t.page.onLoad(this, o), a = !1, s = !1, e = 2, this.LoadCashList(o.status || -1);
    },
    onReady: function() {},
    onShow: function() {
        myVue.getApp.page.onShow(this);
    },
		onHide: function() {
        myVue.getApp.page.onHide(this);
    },
    onUnload: function() {
        myVue.getApp.page.onUnload(this);
    },
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var t = this;
        s || a || (s = !0, myVue.getApp.request({
            url: myVue.getApp.api.share.cash_detail,
            data: {
                status: t.data.status,
                page: e
            },
            success: function(s) {
                if (0 == s.code) {
                    var o = t.data.cash_list.concat(s.data.list);
                    t.setData({
                        cash_list: o
                    }), 0 == s.data.list.length && (a = !0);
                }
                e++;
            },
            complete: function() {
                s = !1;
            }
        }));
    },
		methods: {
			LoadCashList: function(t) {
        var a = this;
        a.setData({
            status: parseInt(t || -1)
        }), myVue.getApp.core.showLoading({
            title: "正在加载",
            mask: !0
        }), myVue.getApp.request({
            url: myVue.getApp.api.share.cash_detail,
            data: {
                status: a.data.status
            },
            success: function(t) {
                0 == t.code && a.setData({
                    cash_list: t.data.list
                }), a.setData({
                    show_no_data_tip: 0 == a.data.cash_list.length
                });
            },
            complete: function() {
                a.getApp.core.hideLoading();
            }
        });
    },
		},
	}
</script>

<style scoped>
.info {
    width: 100%;
}

.width {
    width: 20%;
    text-align: center;
}

.active {
    color: #ff4544;
    border-bottom: 4upx #ff4544 solid;
}

.info .info-title {
    width: 100%;
    height: 100upx;
    padding: 0 24upx;
    border-bottom: 1upx #ccc solid;
    background-color: #fff;
    position: fixed;
    left: 0;
    top: var(--window-top);
    z-index: 1000;
}

.info .info-title .info-text {
    height: 100upx;
    line-height: 100upx;
}

.info .info-content {
    width: 100%;
    padding: 0 24upx;
    background-color: #fff;
}

.info .info-content .info-label {
    border-bottom: 1upx #ccc solid;
    padding: 24upx 0;
    width: 100%;
}

.info .info-content:last-child .info-label {
    border: none;
}

.info-content .info-label .info-left {
    width: 60%;
}

.info-content .info-label .info-left .info-up {
    color: #353535;
    margin-bottom: 20upx;
}

.info-content .info-label .info-left .info-down {
    font-size: 9pt;
    color: #666;
}

.info-content .info-label .info-right {
    width: 40%;
    text-align: right;
    line-height: 100upx;
    color: #ff4544;
}

.info-no {
    width: 100%;
    height: 90upx;
    line-height: 90upx;
    text-align: center;
    padding: 10upx;
    color: #666;
}
</style>
